﻿#include "CmdProjectTreeSelectionChanged.h"
#include <QFile>
#include <QDebug>
#include "BaseModule/IBaseSignal.h"
#include "PostCommandPy.h"

namespace PostCommand
{
    CmdProjectTreeSelectionChanged::CmdProjectTreeSelectionChanged()
        : CommandBase()
    {
        this->initCmdName();
    }
    CmdProjectTreeSelectionChanged::~CmdProjectTreeSelectionChanged()
    {

    }

    bool CmdProjectTreeSelectionChanged::execute()
    {
        bool _success = false;
        if (!m_projectTreeSelctedRowIDList.isEmpty())
        {
            emit IBaseSignalInstance->signal_projectTreeSelectionChanged(m_projectTreeSelctedRowIDList, &_success);
        }
        else
        {
            qDebug() << "CmdProjectTreeSelectionChanged::execute() RowList is empty!";
        }
        return _success;
    }

    void CmdProjectTreeSelectionChanged::undo()
    {
        
    }

    void CmdProjectTreeSelectionChanged::redo()
    {
        //execute();
    }

    void CmdProjectTreeSelectionChanged::setprojectTreeSelctedRowIDList(QList<int> projectTreeSelctedRowIDList)
    {
        m_projectTreeSelctedRowIDList = projectTreeSelctedRowIDList;
    }

}
